//
//  NSAttributedString+XYAdd.h
//  PeiJue
//
//  Created by lxy on 2017/9/28.
//  Copyright © 2017年 lixiya. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN
@interface NSAttributedString (XYAdd)

- (CGSize)xy_sizeForFont:(UIFont *)font size:(CGSize)size;
- (CGFloat)xy_widthForFont:(UIFont *)font;
- (CGFloat)xy_heightForFont:(UIFont *)font width:(CGFloat)width;


/** 由多个attributedString拼接成新的attributedString，item意为由text或image生成的单个attributedString */
+ (NSAttributedString *)fixAttributeStrWithItems:(NSArray *)items;


/** 由text生成attributedString */
+ (NSAttributedString *)attributedStrWithText:(NSString *)text textColor:(UIColor *)color textFont:(UIFont *)font;

/**
 *文字距离UILabel底部基线的高度，设置文字居中的
 */
+ (NSAttributedString *)attributedStrWithText:(NSString *)text textColor:(UIColor *)color textFont:(UIFont *)font baselineOffset:(CGFloat)offSet;


/** 由image生成attributedString */
+ (NSAttributedString *)attributedStrWithImage:(UIImage *)image imageBounds:(CGRect)bounds;

@end
NS_ASSUME_NONNULL_END
